<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta name="google" value="notranslate" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <title>{$Think.config.app.Title ?? ''} - 登录</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="/static/css/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/login.css" />    
    <style type="text/css">
    html,body{min-height: 100vh;}
    .l-form[role="login"]{padding:0 50px;}
    </style>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="/static/js/public.core.js"></script>
    <script src="/static/js/md5.min.js"></script>
</head>

<body>
    <div class="container">
        <div class="head-wrap">
            <div class="main-wrap">
                <div class="login-wrap">
                    <img src="/static/images/login/logo-large.png" />
                </div>
            </div>
        </div>
    
        <div class="body-wrap">
            <div class="main-wrap">
                <img src="/static/images/login/login-left.png" alt="" class="login-leftbg">
                <form class="l-form" role="login" method="post" onsubmit="return SysLogin(this);">
                    <div class="form-wrap">
                        <h2 class="login-title">{$Think.config.app.Title ?? ''}</h2>
                        <div class="input-wrap">
                            <div class="icon">
                                <i class="iconfont iconhuiyuan1"></i>
                            </div>
                            <input type="text" name="uname" placeholder="请输入账户" autocomplete="off" class="input">
                        </div>    
                        <div class="input-wrap">
                            <div class="icon">
                                <i class="iconfont iconmima"></i>
                            </div>
                            <input type="password" name="password" placeholder="请输入密码" autocomplete="off" class="input">
                        </div>
                        <p class="colortip" style="color:red;line-height:30px;height:30px;"></p>
                        <button style="background-color:#105CFB !important;margin-top:15px;" class="login-btn" type="submit">登录</button>
                    </div>
                </form>
            </div>
        </div>
    
        <div class="footer-wrap"></div>
    
    </div>
<script type="text/javascript">
SysLogin = function(form){
    var form = $(form);
    var p = {
		'uname'    : $.trim(form.find('input[name="uname"]').val()),
		'password' : $.trim(form.find('input[name="password"]').val()),
    }
    form.find('.colortip').html('');
    if (!Core.rule('uname',p['uname'])){
		form.find('.colortip').html("请输入账户").show();return false;
    }else if (!Core.rule('password',p['password'])){
        form.find('.colortip').html("请输入密码").show();return false;
    }
    form.find(":button").attr('disabled','disabled');
    p['password'] = MD5(p['password']);
    $.ajax({type : "POST",dataType: "json",cache : false, url : "/login?r="+Math.random(),data : p,success: function(data){
			if (data['state'] == 'y'){
				window.location.href = "/";
			} else {
			   form.find(":button").removeAttr('disabled');
			   form.find('.colortip').html(data['msg']).show();
		   }
		}
	});
    return false;
}
$(document).ready(function(){
    $('.v-toggle-psw').click(function(){
        $(this).toggleClass('open');
        $(this).parent('.input-row').find('input').attr("type",$(this).hasClass("open") ? 'text' : 'password');
        if ($(this).hasClass("open")) {
            $(this).parent('.input-row').find('input').attr("type",'text');
        }
    });
    var _www = window.location.href;
    if(_www.indexOf('caridcc')>-1 || _www.indexOf('test-')>-1){
        var _sys_title = $('.wrap-login').find('.p_h4').text();
        $('.wrap-login').find('.p_h4').text(_sys_title+' - 测试服');
    }
});
</script>
</body>
</html>